﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.TeamFoundation.VersionControl.Server;
using Microsoft.TeamFoundation.Common;
using Microsoft.TeamFoundation.Framework.Server;

namespace CodePlex.TfsPluginSuite
{
    public abstract class CheckinNotificationPolicy : ISubscriber
    {

        public abstract string Name { get; set; }

        public abstract SubscriberPriority Priority { get; set; }

        public EventNotificationStatus ProcessEvent(TeamFoundationRequestContext requestContext, NotificationType notificationType, object notificationEventArgs, out int statusCode, out string statusMessage, out ExceptionPropertyCollection properties)
        {
            properties = new ExceptionPropertyCollection();
            statusMessage = String.Empty;
            statusCode = 0;

            CheckinNotification args = notificationEventArgs as CheckinNotification;
            return this.ProcessCheckin(args);
        }

        public Type[] SubscribedTypes()
        {
            return new Type[1] { typeof(CheckinNotification) };
        }

        public abstract EventNotificationStatus ProcessCheckin(CheckinNotification args);

    }
}
